NPA-6426: Correctly specify and handle FHIR composite search logic for GET Consent status#327
NPA-6426: Correctly specify and handle FHIR composite search logic for GET Consent status#327
Conversation
…r get consent status parameter
|
This branch is work on a ticket in the NHS Digital NPA JIRA Project. Here's a handy link to the ticket: NPA-6426 |
|
|
||
| - **AND** — repeated parameters, e.g. `status=active&status=proposed`. For a single-valued field like `status`, AND groups are intersected; disjoint groups will return no results. | ||
|
|
||
| - **AND of ORs** — e.g. `status=active,proposed&status=inactive`. |
There was a problem hiding this comment.
Am i right in thinking this produces no results - because the AND will return no results as no proxy role has multiple statuses?
There was a problem hiding this comment.
Yes, that's my understanding. I've put logic in the get consent lambda validation to return a 422 in this instance. As you say, status is a singleton value for each proxy role, so any AND values that aren't an exact intersect of each other I've treated as invalid because it may give unexpected results.
i.e. for "status=active, proposed&status=active" the caller may be expecting active or proposed, but this could only return active roles because of the extra AND active clause.
Pull Request
🧾 Ticket Link
https://nhsd-jira.digital.nhs.uk/browse/NPA-6426
📄 Description/Summary of Changes
🧪 Developer Testing Carried Out
📋 PR Principles
🏷️ Naming Conventions Reminder
Please ensure the following naming conventions are followed:
NPA-XXXX: <short-description><type>/NPA-XXXX/<short-description>NPA-XXXX: <short-description>